<?php 
class CBaseSeo extends CBaseEosSingular {

	protected $m_intId;
	protected $m_strPage;
	protected $m_strMetaTitle;
	protected $m_strMetaKeywords;
	protected $m_strMetaDescription;
			
	public function __construct() {		
		parent::__construct();
		return true;
	}
	
	/**************************************
	************* SET FUNCTIONS ***********
	**************************************/
	
	public function setId( $intId ) {
		$this->m_intId = $intId;
	}
	
	public function setPage( $strPage ) {
		$this->m_strPage = $strPage;
	}
	
	public function setMetaTitle( $strMetaTitle ) {
		$this->m_strMetaTitle = $strMetaTitle;
	}
	
	public function setMetaKeywords( $strMetaKeywords ) {
		$this->m_strMetaKeywords = $strMetaKeywords;
	}
	
	public function setMetaDescription( $strMetaDescription ) {
		$this->m_strMetaDescription = $strMetaDescription;
	}	

	/**************************************
	************* GET FUNCTIONS ***********
	**************************************/
	
	public function getId() {
		return $this->m_intId;
	}
		
	public function getPage() {
		return $this->m_strPage;
	}
	
	public function getMetaTitle() {
		return $this->m_strMetaTitle;
	}
	
	public function getMetaKeywords() {
		return $this->m_strMetaKeywords;
	}
	
	public function getMetaDescription() {
		return $this->m_strMetaDescription;
	}	
	
	/**************************************
	************* DATABASE FUNCTIONS ***********
	**************************************/
	
	public function insert( $objDatabase ) {
		$strSql  = ' INSERT INTO `seos` (`page`,`meta_title`,`meta_keywords`,`meta_description`)';   
		$strSql .= ' VALUES ( \'' . $this->getPage() . '\',';
		$strSql .= ' \'' . $this->getMetaTitle() . '\',';
		$strSql .= ' \'' . $this->getMetaKeywords() . '\',';
		$strSql .= ' \'' . $this->getMetaDescription() . '\');';

		parent::insertRecord( $strSql, $objDatabase );
	}
	
	public function update( $objDatabase ) {
		$strSql  = ' UPDATE `seos` SET ';
		$strSql .= ' `page` = \'' . $this->getPage() . '\',';
		$strSql .= ' `meta_title` =  \'' . $this->getMetaTitle() . '\',';
		$strSql .= ' `meta_keywords` = \'' . $this->getMetaKeywords() . '\',';
		$strSql .= ' `meta_description` = \'' . $this->getMetaDescription() . '\'';
		$strSql .= ' WHERE `id` = \'' . $this->getId() . '\';';
			
		return parent::updateRecord( $strSql, $objDatabase );
	}
}

?>